#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from controls import data_prov_base_mysql
from utils import log
from utils.session_base import ApiGuest
from utils.session_mc import BaseHandler


class ListHandler(BaseHandler):
    @ApiGuest
    def post(self):
        prov_list = data_prov_base_mysql.get_all_prov_base()

        res = {
            'idx': self.ss_idx,
            'ret': 0,
            'msg': 'ok',
            'res': prov_list
        }
        self.write(json.dumps(res))
        self.finish()
        return
